package com.zoshine.zzg.exception;

/**
 * 错误信息枚举
 *
 * @author 贾俊峰
 * @time 2017/6/19 16:18
 */
public enum ErrorMessage {
    //=========系统(system)
//    SUCCESS(0, "success"),
    SYSTEM_ERROR(1, "系统错误"),
    NETWORK_ERROR(2, "网络错误"),
    UNKNOWN_ERROR(3, "未知错误"),
    REQUEST_TYPE_ERROR(4, "请求类型错误"),
    REQUEST_PARAM_CAN_NOT_NULL(5, "缺少请求参数"),
    REQUEST_PARAM_TYPE_ERROR(6, "参数类型错误"),
    MODEL_CAN_NOT_FOUND(7, "传入参数查询不到对象"),
    DAO_BINDING_ERROR(8, "持久层绑定异常"),
    ENVIRONMENT_IS_NOT_DEFINED(9, "项目运行环境未定义"),
    CREATE_FILE_ERROR(10, "创建文件时出错"),
    INVALID_REQUEST_PATH(404, "无效的请求路径"),

    //========身份验证，权限类(auth) 1000
    SUPER_ADMIN_CAN_NOT_DELETE(1000, "超级管理员不可删除"),
    PATCHCA_ERROR(1001, "验证码错误"),
    USERNAME_NOT_EXIST(1002, "用户名不存在"),
    PASSWORD_MISTAKE(1003, "密码错误"),
    NO_LOGIN(1004, "尚未登录"),
    USERNAME_ALREADY_EXIST(1005, "用户名已存在"),
    CHECK_CODE_MISTAKE(1006, "验证码错误"),
    NO_POWER(1007, "没有权限"),
    USER_ID_CAN_NOT_NULL(1008, "用户ID不能为空"),
    USER_PASSWORD_CAN_NOT_NULL(1009, "登录密码不能为空"),
    USER_LOGIN_NAME_CAN_NOT_NULL(1010, "登录名不能为空"),
    DETAIL_ID_NOT_NULL(1011, "用户信息ID不能为空或小于0"),
    USER_ROLE_ID_NOT_NULL(1012, "用户关联的角色ID不能为空"),
    USER_ORG_ID_NOT_NULL(1013, "用户关联的组织ID不能为空"),
    USERNAME_NOT_NULL(1014, "用户名不能为空"),
    PASSWORD_NOT_NULL(1015, "密码不能为空"),
    USER_STATUS_NOT_NULL(1016, "用户状态不能为空"),
    USER_NAME_ALREADY_OCCUPIED(1017, "用户名已被占用"),
    HISTORY_PASSWORD_IS_NOT_NULL(1018,"原密码不能为空"),
    HISTORY_PASSWORD_IS_NOT_CORRECT(1019,"原密码不正确"),
    NEW_PASSWORD_IS_NOT_NULL(1020,"新密码不能为空"),
    //DETAIL_USER_ID_NOT_NULL(1013,"关联用户ID不能为空"),
    //DETAIL_AGE_NOT_NULL(1014,"年龄不能为空"),
    //DETAIL_SEX_NOT_NULL(1015,"性别不能为空"),
    //DETAIL_ADDRESS_NOT_NULL(1016,"地址不能为空"),
    //DETAIL_MAIL_NOT_NULL(1017,"邮箱不能为空或格式不正确"),
    //DETAIL_MOBILEPHONE_NOT_NULL(1018,"手机号码不能为空或格式不正确"),

    //========商品类(goods) 2000
    GOODS_ID_CAN_NOT_BE_NULL_OR_UNDER_ZERO(2001, "商品编号不能为空或小于0"),
    GOODS_NAME_CAN_NOT_BE_NULL(2002, "商品名称不能为空"),
    GOODS_TYPE_CAN_NOT_BE_NULL_OR_INCORRECT(2003, "商品类型不能为空或不正确"),
    GOODS_BAR_CODE_CAN_NOT_BE_NULL(2004, "商品条码不能为空"),
    GOODS_MARKET_PRICE_CAN_NOT_BE_NULL(2005, "商品市场价不能为空或小于等于0"),
    GOODS_SELL_PRICE_CAN_NOT_BE_NULL(2006, "商品销售价不能为空或小于等于0"),
    GOODS_SETTLEMENT_PRICE_CAN_NOT_BE_NULL(2007, "商品结算价不能为空或小于等于0"),
    GOODS_SPEC_CAN_NOT_BE_NULL(2008, "商品规格不能为空"),
    GOODS_UNIT_CAN_NOT_BE_NULL(2009, "商品单位不能为空"),
    GOODS_STATUS_CAN_NOT_BE_NULL_OR_INCORRECT(2010, "商品状态不能为空或不正确"),
    GOODS_NOT_EXIST(2011, "商品信息不存在"),
    GOODS_PUBLISH_PRISON_EXIST(2012, "该商品已在该监所上架"),
    //===商品类型(goodsType)
    GOODS_TYPE_ID_CAN_NOT_BE_NULL(2101, "商品类型名称不能为空"),
    GOODS_TYPE_NAME_CAN_NOT_BE_NULL(2102, "商品类型名称不能为空"),
    GOODS_TYPE_NAME_CAN_NOT_OVER_20(2103, "商品类型名称不能超过20字符"),
    //====历史商品记录
    GOODS_HISTORY_ID_CAN_NOT_NULL(2201, "历史商品记录ID不能为空"),
    GOODS_STATUS_CAN_NOT_BACK(2202,"上下架的商品不能修改和删除"),
    //====商品上下架
    GOODS_STATUS_ERROR(2301, "商品状态错误：{0}"),



    //========订单类（order）3000
    //犯人订单
    ORDER_PRISONER_ID_CAN_NOT_NULL(3001, "点单编号不能为空"),
    ACCOUNT_PRISONER_ID_CAN_NOT_NULL(3002, "犯人编号不能为空"),
    CREATE_TYPE_CAN_NOT_NULL(3003, "点单创建类型不能为空"),
    CREATE_TYPE_BETWEEN_0_AND_9(3004, "点单创建类型范围0-9"),
    PRISONER_MESSAGE_NOT_BE_NULL(3005, "未找到对应的犯人信息"),
    GOODS_MESSAGE_NOT_BE_NULL(3006, "未找到对应的商品信息"),
    GOODS_COUNT_NOT_BE_NULL(3007, "保存的商品数量需大于0且不能为空"),
    MONEY_OUT_OF_RANGE(3008, "点单超额"),
    ORDER_STATUS_IS_NOT_CORRECT(3009, "点单审核通过才能生成供应商订单"),
    //犯人订单详情
    ORDER_PRISONER_DETAIL_ID_CAN_NOT_NULL(3010, "点单详情编号不能为空"),
    //供应商订单
    ORDER_SUPPLIER_ID_CAN_NOT_NULL(3020, "供应商订单编号不能为空"),
    ACCOUNT_PRISONS_ID_CAN_NOT_NULL(3021, "监所账号不能为空"),
    ACCOUNT_SUPPLIER_ID_CAN_NOT_NULL(3022, "供应商账号不能为空"),
    //犯人卡号查询姓名
    PRISONER_BANKCARD_NOT_NULL(3030, "卡号错误"),

    //收货单
    ORDER_RECEIVE_ID_CAN_NOT_NULL(3030, "收货单编号不能为空"),
    SEND_GOODS_OUT_OF_BOUNDS(3031,"发货数量超标"),
    GOODS_RETURN_CAN_NO_OUT_RELEASE_NUMBER(3032,"缺货数量不大于发放数量"),
    PENDING_BACK_GOODS(3033,"缺货状态必须是待补货"),
    PENDING_GOODS_RETURN(3034,"缺货状态必须是待收货"),
    //========菜单类（menu）4000
    MENU_ID_CAN_NOT_BE_NULL(4001, "菜单编号不能为空"),
    MENU_NAME_CAN_NOT_BE_NULL(4002, "菜单名称不能为空"),
    //    MENU_LEVEL_CAN_NOT_BE_NULL(4003, "菜单级别不能为空"),
    //    MENU_SORT_CAN_NOT_BE_NULL(4004, "菜单排序不能为空"),
    MENU_ID_ALREADY_EXIST(4005, "菜单编号已经存在"),
    MENU_ID_MUST_BE_6_NUMBER(4006, "菜单编号必须是6位数字"),
    MENU_NAME_LENGTH_CAN_NOT_OVER_20(4007, "菜单名称不能超过20个字符"),
    PARENT_MENU_NOT_EXIST(4008, "父菜单不存在"),
    MENU_ICON_LENGTH_CAN_NOT_OVER_60(4009, "菜单图标不能超过60个字符"),
    PID_CAN_NOT_BE_NULL(4010, "参数pid不能为空"),
    MENU_STATUS_CAN_NOT_BE_NULL(4011, "菜单状态不能为空"),
    //==========组织(organization) 5000
    ORG_ID_CAN_NOT_NULL(5000, "组织ID不能为空"),
    ORG_NAME_CAN_NOT_NULL(5001, "组织名称不能为空"),
    ORG_TYPE_CAN_NOT_NULL(5002, "组织类型不能为空"),
    ORG_NAME_CAN_NOT_OVER_60(5003, "单位名称不能超过60个字符"),
    ORG_TYPE_BETWEEN_0_AND_9(5004, "单位类型介于0-9之间"),
    ORG_NAME_CAN_NOT_REPEAT(5005, "单位已存在"),
    //===========角色(role) 6000
    ROLE_ID_CAN_NOT_NULL(6000, "角色编号不能为空"),
    ROLE_NAME_CAN_NOT_NULL(6001, "角色名称不能为空"),
    ROLE_ORG_CAN_NOT_NULL(6002, "角色关联单位不能为空"),
    ROLE_CAN_NOT_REPEAT(6003, "已存在相同的角色名"),
    ROLE_STATUS_CAN_NOT_NULL(6004, "角色状态不能为空"),
    //账户(account)
    ACCOUNT_STATUS_CAN_NOT_BE_NULL(7000, "账户状态不能为空"),
    ACCOUNT_ID_CAN_NOT_BE_NULL(7001, "账户ID不能为空"),
    ACCOUNT_MONEY_CAN_NOT_BE_NULL(7002, "账户金额不能为空"),
    //犯人信息(8000)
    PRISONER_ID_CAN_NOT_NULL(8000, "犯人信息ID不能为空"),
    SETTLEMENT_ID_CAN_NOT_NULL(8001, "犯人结算ID不能不能为空"),

    //===========文件上传下载，导入导出(file) 9000
    FILE_CAN_NOT_BE_NULL(9001, "文件不能为空"),
    IMPORT_FILE_ERROR(9002, "导入的文件有误"),
    IMPORT_FILE_TARGET_ERROR(9003, "文件导入目标错误，请检查导入的文件是否匹配目标服务器"),
    IMPORT_FILE_REPEAT(9004, "重复导入，请检查导入文件的序列号"),
    IMPORT_FILE_JUMP(9005, "前置数据未导入，请先导入序列号为{0}的文件"),
    FILE_LINK_IS_INVALID(9006, "链接已失效"),
    //=========收货单，发放单
    AUDIT_STATUS_SHOLUD(10000,"不能回退状态"),
    NOT_CHANGE_FINISH(10001,"已发货的商品信息不能修改"),
    NO_AUDIT_AGAIN(10002,"收发货单无需重复确认"),
    OUT_OF_STOCK(10003,"缺货状态,不能收货"),
    BACK_ERROR(10004,"数量为负数,系统运算出错"),
    STATUS_SHOULD_BE_DELIVERY(10005,"发放单状态必须是待发货"),
    STATUS_SHOULD_BE_FINISH(10006,"发放单状态必须是已导入内网状态"),
    STATUS_SHOULD_BE_CONFIRM(10007,"发放单状态必须是已收货"),
    STATUS_SHOULD_BE_RELEASE(10008,"发放单状态必须是已生成发放单"),
    INVOICE_ID_CAN_NOT_BE_NULL(10009,"发货单ID不能为空"),
    GOODS_RETURN_COUNT_CAN_NOT_NULL(10010,"缺货数量不能为空且大于0"),
    GOODS_RETURN_SHOULD_OUT_OR_RELEASE(10011,"发货单状态必须是已生成发放单或者缺货状态"),
    GOODS_RETURN_SETTLEMENT(10012,"订单状态必须全部完成"),
    GOODS_RETURN_SHOULD_BE_AUDIT(10013,"缺货单状态必须是待收货状态"),
    GOODS_RETURN_SHOULD_BE_PENDING_BACK_GOODS(10014,"缺货单状态必须是待补货状态"),
    //结算单
    STATUS_SHOULD_BE_PENDING_RECEIVE(11000,"状态必须是待提交审核状态"),
    STATUS_SHOULD_BE_AUDITING(11001,"状态必须是待审核状态"),
    STATUS_SHOULD_BE_AUDITED(11002,"状态必须是待申请发票状态"),
    STATUS_SHOULD_BE_APPLY_FOR_INVOICE(11003,"状态必须是待寄送发票状态"),
    STATUS_SHOULD_BE_SEND_INVOICE(11004,"状态必须是待收取发票状态"),
    STATUS_SHOULD_BE_RECEIVE_INVOICE(11005,"状态必须是待提交银行状态"),
    //供应商监所关系
    RELATION_HAS_BEN_EXIT(12000,"关系表已存在"),
    RELATION_HAS_BEN_AUDIT(12001,"状态必须是待审核状态"),
    RELATION_STATUS_BEN_AUDIT(12002,"已是初始化状态"),
    //流动类型
    FLOW_TYPE_IS_NOT_NULL(13000,"流动类型名称不能为空"),
    FLOW_TYPE_IS_EXIT(13001,"流动类型名称已存在"),
    //家属下单
    FAMILY_MEMBER_ID_NOT_NULL(14000,"家属编号不能为空"),
    FAMILY_MEMBER_GOODS_NOT_NULL(14001,"无商品信息"),
    FAMILY_MEMBER_ORDER_STATUS_NOT_CORRECT(14002,"只能撤回待支付的商品"),
    PAY_NOT_CORRECT(14003,"支付方式错误"),
    FAMILY_MEMBER_ORDER_PAY_NOT_CORRECT(14004,"订单状态必须为待支付"),
    FAMILY_MEMBER_ORDER_NOT_FIND(14005,"未找到对应的家属点单信息"),
    BANK_CARD_NOT_NULL(14005,"银行卡号不能为空"),

    ;
    //==============================================================
    /** 错误码 */
    private Integer code;
    /** 错误信息 */
    private String msg;

    ErrorMessage(final int code, final String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
